<form action="{{ path('user_message_create') }}" method="post" class="messageForm form-horizontal" {{ form_enctype(form) }}>
    <fieldset>
        <legend>{% trans %}Send Message{% endtrans %}</legend>
        <hr class="smallHr" />
        {% if form_errors(form) %}
        <div class="control-group">
            <div class="alert-error alert">
                <button type="button" class="close" data-dismiss="alert">&times;</button>
                {{ form_errors(form) }}
            </div>
        </div>
        {% endif %}
        <div class="control-group">
            <label class="control-label">{% trans %}Write your message here{% endtrans %}</label>
            <div class="controls">
                {{ form_widget(form.message, {'attr': {'class': 'input-xxlarge'} }) }}
            </div>
        </div>
        {% if form_errors(form.message) %}
        <div class="control-group">
            <div class="alert-error alert">
                <button type="button" class="close" data-dismiss="alert">&times;</button>
                {{ form_errors(form.message) }}
            </div>
        </div>
        {% endif %}
        <div class="control-group">
            <label class="control-label">{% trans %}Upload{% endtrans %}</label>
            <div class="controls fileUploadDiv">
                {{ form_widget(form.file, {'attr': {'class': 'browseHidden left input-xxlarge', 'tabindex': '-1', 'onchange': "$('.fakeTextBox').val($('.browseHidden').val());"} }) }}
                <div class="browseVisible left">
                    <input type="text" class="fakeTextBox left"/>
                    <button type="submit" tabindex="-1" class="btn browseBtn blue left">{% trans %}Browse{% endtrans %}</button>
                </div>

                <span class="help-block">{% trans %}Uploads should be in Word or PDF format{% endtrans %}</span>
            </div>
        </div>
        {% if form_errors(form.file) %}
        <div class="alert-error alert">
            <button type="button" class="close" data-dismiss="alert">&times;</button>
            {% for formError in form.file.vars.errors %}
            {{ formError.message }}
            {% endfor %}
        </div>
        {% endif %}

        <div class="control-group">
            <label class="control-label">&nbsp;</label>
            <div class="controls">
                <label class="checkbox">
                    <input{% if app.user.messageNotify %} checked=""{% endif %} name="notify" type="checkbox" /> {% trans %}Notify me by Email when I have a message{% endtrans %}
                </label>
            </div>
        </div>

        <div class="control-group">
            <div class="controls">
                {{ form_rest(form) }}
                <button class="btn blue submit messageFormSubmit" type="submit">{% trans %}Send{% endtrans %}</button>
            </div>
        </div>

    </fieldset>
</form>